import request from '@/utils/request';
import { wipeSpace } from 'mite-ui/es/_util';

export async function login(data) {
  return request('/auth/login', {
    method: 'post',
    data,
  });
}

export async function singlePointLogin(params) {
  console.log(params);
  return request('/login/tokenLogin', {
    method: 'post',
    params,
  });
}

export async function forgetPassword(data) {
  console.log(data);
  return request('/login/forgetPassword', {
    method: 'post',
    data: data.phoneNum ? { ...data, phoneNum: wipeSpace(data.phoneNum) } : data,
  });
}
